<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Dog {
            constructor(name,breed){
                this.name = name;
                this.breed = breed;
            } 
        
        bark(){
            console.log(`Bark Bark~ My name is${this.name}`);
        }
        cuddle(){
            console.log(`I love you owner!`);
        }
        //static 属于类本身，不会被调用
        static info() {
            console.log('A dog is better than a cat by 10 times');
        }
        get description(){
            return `${this.name} is a ${this.breed} type of dog `
        }
        set nicjnames(value){
            this.nick = value.trim();
        }
        get nicknames(){
            return this.nick;
        }
    }
    Dog.info();
    var dahuang = new Dog('Sunny','Goldren Doodle')
    // console.log(dahuang.info);
    console.log(dahuang.description);
    dahuang .nicjnames = "大黄";
    console.log(dahuang.nicjnames);
    console.log(dahuang.__proto__);
    </script>
</body>
</html>